package com.kerry.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.kerry.aop.MethodLog;
import com.kerry.mapper.UserMapper;
import com.kerry.model.User;
import com.kerry.service.UserService;


@Service
public class UserServiceImpl implements UserService{

	@Autowired
	private UserMapper userMapper;
	
	@MethodLog(module="用户",funtion="添加用户")
	@Transactional
	@Override
	public void insert123(User user) throws Exception {
		// TODO Auto-generated method stub
		userMapper.insert(user);
		throw new NullPointerException("nullpoint exception!!!!!");
		
	}
	
	
	@Override
	public List<User> getAll() {
		// TODO Auto-generated method stub
		return userMapper.getAll();
	}

	@Override
	public User getOne(Integer id) {
		// TODO Auto-generated method stub
		return userMapper.getOne(id);
	}

	@Override
	public void update(User user) {
		// TODO Auto-generated method stub
		userMapper.update(user);
	}

	@Override
	public void delete(Integer id) {
		// TODO Auto-generated method stub
		userMapper.delete(id);
	}
	

}
